package me.dqn.noway.util;

import com.google.gson.Gson;

import me.dqn.noway.bean.AddInfoResponse;
import me.dqn.noway.bean.AllResponse;
import me.dqn.noway.bean.DeleteInfoResponse;

public class ResponseMapper {
    public static AllResponse mapToAllResponse(String responseString) throws NullPointerException {
        Gson gson = new Gson();
        return gson.fromJson(responseString, AllResponse.class);
    }

    public static AddInfoResponse mapToAddInfoResponse(String responseString) {
        Gson gson = new Gson();
        return gson.fromJson(responseString, AddInfoResponse.class);
    }

    public static DeleteInfoResponse mapTDeleteInfoResponse(String json) {
        Gson gson = new Gson();
        return gson.fromJson(json, DeleteInfoResponse.class);
    }
}
